#pragma once
#include "Refcount.h"
#include "Component.h"


namespace WL
{
	enum EntityType
	{
		Entity,
		Camera,
		Light,
		Actor,
		Sky,
		Terrain,
		SkyBox,
		Ocean,
		Gui,
	};

	class CEntity : public CRefcount,
					public ComponentGrounp
	{
		friend class CScene;
		friend class CEntityFactory;

	public:
		CEntity();
		CEntity(const CEntity& entity);
		CEntity(CEntity&& entity)noexcept;
		virtual ~CEntity();
		EntityType getEntityType() const;
		const std::string& getName() const;
		void setName(const std::string& szName);
		UINT32 getID() const;
		void setVisible( bool bValue);
		bool isVisible() const;
		void show();
		void hide();
		bool enterScene(CScene* pScene);
		bool leaveScene(CScene* pScene);
		CEntity& operator = (CEntity&& entity)noexcept;
		CEntity& operator = (const CEntity& entity);

	protected:
		virtual void _tick(UINT32 dt);

	protected:
		std::string mszName = "Entity";
		EntityType	mType = Entity;
		UINT32		mID = 0;
		CScene*		mpScene = nullptr;
		bool		mbVisible = true;
	};


}